package com.javacoo.sftp.client.config;

import org.apache.commons.pool2.impl.EvictionPolicy;
import org.apache.commons.pool2.impl.GenericKeyedObjectPoolConfig;

import com.javacoo.sftp.client.template.SftpTemplate;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * sftp连接池配置
 * <li></li>
 * @author duanyong@jccfc.com
 * @date 2020/5/14 10:48
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SftpPoolConfig extends GenericKeyedObjectPoolConfig<SftpTemplate> {
    private int maxTotal;
    private int maxIdle;
    private int minIdle;
    private boolean lifo;
    private boolean fairness;
    private long maxWaitMillis;
    private long minEvictableIdleTimeMillis;
    private long evictorShutdownTimeoutMillis;
    private long softMinEvictableIdleTimeMillis;
    private int numTestsPerEvictionRun;
    private EvictionPolicy<SftpTemplate> evictionPolicy; // 仅2.6.0版本commons-pool2需要设置
    private String evictionPolicyClassName;
    private boolean testOnCreate;
    private boolean testOnBorrow;
    private boolean testOnReturn;
    private boolean testWhileIdle;
    private long timeBetweenEvictionRunsMillis;
    private boolean blockWhenExhausted;
    private boolean jmxEnabled;
    private String jmxNamePrefix;
    private String jmxNameBase;
    /** 获取连接重试次数 */
    private int retryCount;

}
